package com.byxy.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.byxy.entity.User;
import com.byxy.service.ReplyService;

@Controller
public class ReplyController {
	@Autowired
	private ReplyService replyService;
	
	@RequestMapping("publishReply.do")
	public String publishReply(@RequestParam("tip_id") Integer tipId ,@RequestParam("reply_content") String replyContent,HttpSession session) {
		User user = (User) session.getAttribute("USER");
		replyService.add(tipId,replyContent,user.getUserId());
		return "redirect:showTip.do?tipId="+tipId;
	}
}
